﻿///<reference path="../jquery/jquery.js"/>
var PortalFile = function() {
	//private area
	var _ajaxDefaultOpts = {
		type: 'post',
		dataType: 'json',
		contentType: 'application/json;charset=utf-8'
	};

	return {
		Asmx: "",
		AlbumID: "",
		Init: function(opts) {
			PortalFile.Asmx = opts.Asmx || "";
			PortalFile.AlbumID = opts.AlbumID || "";
		}, //endof Init
		PreEdit: function(id, opts) {
			//prepare ajax opts
			var ajaxOpts = _ajaxDefaultOpts;
			ajaxOpts.url = PortalFile.Asmx + "PreEdit";
			ajaxOpts.data = $.toJSON({ Params: { id: id} });
			ajaxOpts.success = function(data) {
				data = data.d;
				$("#fileDetail").html(data.fileHtml);
			}
			//Request to server
			$.ajax(ajaxOpts);
			ajaxOpts = null;
		} //endof preedit
	};
} ();